package com.lxy.dataservice.controller.resolver;

import com.coxautodev.graphql.tools.GraphQLResolver;
import com.lxy.dataservice.dao.DurgDao;
import com.lxy.dataservice.entity.Durg;
import com.lxy.dataservice.entity.SoldNote;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * SoldResolver
 *
 * @author < a href=" ">BBB</ a>
 * @version v1.0.01
 * @date 2020-01-07 17:35
 */
@Component
@AllArgsConstructor
public class SoldResolver implements GraphQLResolver<SoldNote> {
  @Autowired
  DurgDao durgDao;

  public Durg getDurg(SoldNote entity){
    return durgDao.findById(entity.getDurgsId()).orElse(null);
  }
}
